package apiroutes

import (
	"dataaysn/internal/service"

	"github.com/gin-gonic/gin"
)

func RegisterDeptRoutes(r *gin.Engine, deptService *service.HisDeptService) {
	deptGroup := r.Group("/api/departments")
	{
		deptGroup.POST("", deptService.CreateDept)
		deptGroup.GET("", deptService.ListDeptsByHospital)
		deptGroup.GET("/:code", deptService.GetDeptByCode)
		deptGroup.GET("/hospital/:hospitalCode", deptService.ListDeptsByHospital)
		deptGroup.PUT("/:code", deptService.UpdateDept)
		deptGroup.DELETE("/:code", deptService.DeleteDept)
	}
}
